package server.xml;

import java.util.HashMap;
import java.util.Map;

public final class FilterDef {
    //过滤器类的全类名
    private String filterClass = null;
    //过滤器名称
    private String filterName = null;
    //初始化参数
    private Map<String, String> parameters = new HashMap<>();

    public void addInitParameter(String name, String value) {
        parameters.put(name, value);
    }

    //getter----------------------------------------------------------------------------------

    public String getFilterClass() {
        return filterClass;
    }

    public String getFilterName() {
        return filterName;
    }

    public Map<String, String> getParameterMap() {
        return parameters;
    }


    //setter----------------------------------------------------------------------------------

    public void setFilterClass(String filterClass) {
        this.filterClass = filterClass;
    }

    public void setFilterName(String filterName) {
        this.filterName = filterName;
    }

    @Override
    public String toString() {
        return "FilterDef{" +
                "filterClass='" + filterClass + '\'' +
                ", filterName='" + filterName + '\'' +
                ", parameters=" + parameters +
                '}';
    }
}
